import type { App } from 'vue'

import {
  Layout,
  Menu,
  Breadcrumb,
  Form,
  Result,
  Button,
  Input,
  Checkbox,
  message,
  Row,
  Col,
  Space,
  List,
  Modal,
  Card,
  Image,
  Select,
  Upload
} from 'ant-design-vue'

const antdComponents = [
  Layout,
  Menu,
  Breadcrumb,
  Form,
  Result,
  Button,
  Input,
  Checkbox,
  Row,
  Col,
  Space,
  List,
  Modal,
  Card,
  Image,
  Select,
  Upload
]

// 应用组件
export function useAntd(app: App) {
  // 循环应用
  antdComponents.forEach((com) => {
    app.use(com)
  })
  app.config.globalProperties.$message = message
}
